import request from '@/utils/request'

// 查询building列表
export function listBuilding(query) {
  return request({
    url: '/system/building/list',
    method: 'get',
    params: query
  })
}

// 查询building详细
export function getBuilding(id) {
  return request({
    url: '/system/building/' + id,
    method: 'get'
  })
}

// 新增building
export function addBuilding(data) {
  return request({
    url: '/system/building',
    method: 'post',
    data: data
  })
}

// 修改building
export function updateBuilding(data) {
  return request({
    url: '/system/building',
    method: 'put',
    data: data
  })
}

// 删除building
export function delBuilding(id) {
  return request({
    url: '/system/building/' + id,
    method: 'delete'
  })
}

// 校验当前楼宇下是否存在内容
export function searchAll(id) {
  return request({
    url: '/system/building/del/' + id,
    method: 'delete'
  })
}
  // 查询echarts数据
  export function listRooms(query) {
    return request({
      url: '/system/building/listRooms',
      method: 'get',
      params: query
    })
}

export function buildingList(){
  return request({
    url: '/system/building/building',
    method: 'post'
  })
}
